using System;
using Abp.Auditing;
using Abp.Domain.Uow;
using Abp.Extensions;
using Abp.Runtime.Validation;
using Microsoft.AspNetCore.Mvc;

namespace Abp.AspNetCore.Mvc.Controllers;

public class AbpAppViewController : AbpController
{
    [DisableAuditing]
    [DisableValidation]
    [UnitOfWork(IsDisabled = true)]
    public ActionResult Load(string viewUrl)
    {
        if (viewUrl.IsNullOrEmpty())
        {
            throw new ArgumentNullException(nameof(viewUrl));
        }

        return View(viewUrl.EnsureStartsWith('~'));
    }
}